
package com.yuan.control;

import com.yuan.prefence.Constants;
import com.yuan.prefence.FileConstants;
import com.yuan.prefence.PreferenceKeys;
import com.yuan.prefence.UrlConstants;
import com.yuan.unit.PreferenceUtil;

/**
 * 系统设置控制类
 * 
 * @author YUAN
 */
public class SettingControl implements PreferenceKeys, Constants, UrlConstants, FileConstants {
    public static long SHARETIME = 1000;

    public static boolean IsShare()
    {
        return PreferenceUtil.getInstance().getBoolean(IS_SHARE, false);
    }

    public static void SetShare(boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(IS_SHARE, flag);
    }

    public static boolean IsVolice()
    {
        return PreferenceUtil.getInstance().getBoolean(IS_VOLICE, false);
    }

    public static void SetVolice(boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(IS_VOLICE, flag);
    }

    public static boolean IsAutoCkeckIn()
    {
        return PreferenceUtil.getInstance().getBoolean(AUTO_CHECKIN, false);
    }

    public static void SetAutoCkeckIn(boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(AUTO_CHECKIN, flag);
    }

    public static boolean IsAutoCkeckOut()
    {
        return PreferenceUtil.getInstance().getBoolean(AUTO_CHECKOUT, false);
    }

    public static void SetAutoCkeckOut(boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(AUTO_CHECKOUT, flag);
    }

    public static String getWorkAdress()
    {
        return PreferenceUtil.getInstance().getString(WEEK_ADRESS, null);
    }

    public static void SetWorkAdress(String str)
    {
        PreferenceUtil.getInstance().putString(WEEK_ADRESS, str);
    }

    public static void SetWorkLng(String f)
    {
        PreferenceUtil.getInstance().putString(WEEK_LNG, f);
    }

    public static String getWorkLng()
    {
        return PreferenceUtil.getInstance().getString(WEEK_LNG, null);
    }

    public static String getWorkLat()
    {
        return PreferenceUtil.getInstance().getString(WEEK_LAT, null);
    }

    public static void SetWorkLat(String f)
    {
        PreferenceUtil.getInstance().putString(WEEK_LAT, f);
    }

    public static String getStartWorkTime()
    {
        return PreferenceUtil.getInstance().getString(START_WORK_TIME, null);
    }

    public static void SetStartWorkTime(String str)
    {
        PreferenceUtil.getInstance().putString(START_WORK_TIME, str);
    }

    public static String getEndWorkTime()
    {
        return PreferenceUtil.getInstance().getString(END_WORK_TIME, null);
    }

    public static void SetEndWorkTime(String str)
    {
        PreferenceUtil.getInstance().putString(END_WORK_TIME, str);
    }

    public static boolean IsWork1()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK1, false);
    }

    public static void SetWork1(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK1, flag);
    }

    public static boolean IsWork2()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK2, false);
    }

    public static void SetWork2(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK2, flag);
    }

    public static boolean IsWork3()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK3, false);
    }

    public static void SetWork3(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK3, flag);
    }

    public static boolean IsWork4()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK4, false);
    }

    public static void SetWork4(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK4, flag);
    }

    public static boolean IsWork5()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK5, false);
    }

    public static void SetWork5(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK5, flag);
    }

    public static boolean IsWork6()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK6, false);
    }

    public static void SetWork6(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK6, flag);
    }

    public static boolean IsWork7()
    {
        return PreferenceUtil.getInstance().getBoolean(WEEK7, false);
    }

    public static void SetWork7(Boolean flag)
    {
        PreferenceUtil.getInstance().putBoolean(WEEK7, flag);
    }

    public static void RetConfig()
    {
        PreferenceUtil.getInstance().putBoolean(WEEK7, false);
        PreferenceUtil.getInstance().putBoolean(WEEK6, false);
        PreferenceUtil.getInstance().putBoolean(WEEK5, true);
        PreferenceUtil.getInstance().putBoolean(WEEK4, true);
        PreferenceUtil.getInstance().putBoolean(WEEK3, true);
        PreferenceUtil.getInstance().putBoolean(WEEK2, true);
        PreferenceUtil.getInstance().putBoolean(WEEK1, true);
        SetShare(true);
        SetVolice(true);
        SetAutoCkeckIn(true);
        SetAutoCkeckOut(true);
        SetStartWorkTime("09:00");
        SetEndWorkTime("17:00");
    }

    public static String getSystemData() {
        String result = "";
        return result;
    }

    public static boolean isAutoLogin() {
        return PreferenceUtil.getInstance().getBoolean(AUTO_LOGIN, false);
    }

    public static void setAutoLogin(boolean flag) {
        PreferenceUtil.getInstance().putBoolean(AUTO_LOGIN, flag);
    }

    public static String getUserName() {
        return PreferenceUtil.getInstance().getString(USERNAME, null);
    }

    public static void setUserName(String str) {
        PreferenceUtil.getInstance().putString(USERNAME, str);
    }

    public static String getPsd() {
        return PreferenceUtil.getInstance().getString(PSD, null);
    }

    public static void setPsd(String str) {
        PreferenceUtil.getInstance().putString(PSD, str);
    }

    public static boolean isRememberPsd() {
        return PreferenceUtil.getInstance().getBoolean(ISREMEBERPSD, false);
    }

    public static void setRememberPsd(boolean flag) {
        PreferenceUtil.getInstance().putBoolean(ISREMEBERPSD, flag);
    }

    public static String getCompanyName()
    {
        return PreferenceUtil.getInstance().getString(COMPANY_NAME, null);
    }

    public static void setCompanyName(String str)
    {
        PreferenceUtil.getInstance().putString(COMPANY_NAME, str);
    }

    public static String getCompanyUrl()
    {
        return PreferenceUtil.getInstance().getString(COMPANY_URL, null);
    }

    public static void setCompanyUrl(String str)
    {
        PreferenceUtil.getInstance().putString(COMPANY_URL, str);
    }

}
